home *** CD-ROM | disk | FTP | other *** search
/ Super Shareware Collection / Super Shareware Collection.iso / os_2 / pm22x333.zip / EXAMPLE2.ASM < prev    next >
Assembly Source File  |  1994-02-21  |  2KB  |  59 lines

  1. ; Demonstration of the use of selectors.
  2.  
  3.         .386p
  4. code32  segment para public use32
  5.         assume cs:code32, ds:code32
  6.  
  7. include pmode.inc
  8.  
  9. public  _main
  10.  
  11. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  12. ; DATA
  13. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  14.  
  15. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  16. ; CODE
  17. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  18.  
  19. ;═════════════════════════════════════════════════════════════════════════════
  20. _main:
  21.         sti
  22.  
  23.         mov v86r_ax,3                   ; Clear the screen
  24.         mov al,10h
  25.         int 33h
  26.  
  27.         call _getselector               ; Allocate selector
  28.  
  29.         mov edx,0b8000h                 ; Set base to text vidmem
  30.         call _setselector
  31.  
  32.         mov es,ax                       ; ES -> text vidmem
  33.  
  34.         mov ax,736h                     ; Write first line of '6's
  35.         mov ecx,80
  36.         xor edi,edi
  37.         rep stosw
  38.  
  39.         mov bx,es                       ; DS -> text vidmem
  40.         mov ds,bx
  41.  
  42.         mov ecx,80*24                   ; Write next 24 lines of '6's
  43.         xor esi,esi
  44.         rep movsw
  45.  
  46.         mov ax,cs:_seldata              ; Remember, DS is something else now
  47.         mov ds,ax
  48.         mov es,ax
  49.  
  50.         mov v86r_ah,0                   ; Just wait for a key
  51.         mov al,16h
  52.         int 33h
  53.  
  54.         jmp _exit
  55.  
  56. code32  ends
  57.         end
  58.  
  59.